package com.situ.stl.Service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.situ.stl.model.Reserve;

import java.util.List;

public interface ReserveService {
    //新增预约，返回受影响行数
    int add(Reserve reserve) throws Exception;

    //删除预约，返回受影响行数
    int remove(Integer id) throws Exception;

    //更新预约
    int edit(Reserve reserve) throws Exception;

    //批量更新状态
   int batchUpdateStatus(Integer status, List<Integer> ids) throws Exception;

    //根据ID查询单条
    Reserve getById(Integer id);

    //查询所有预约
    List<Reserve> getAll();

    //多条件查询
    List<Reserve> search(Reserve reserve);

//    分页查询
//    Page<Reserve> searchByPage(Integer pageNo, Integer pageSize, Reserve reserve);

    Page<Reserve> searchByPage(Integer pageNo, Integer pageSize, Reserve reserve,
                               String memberName, String courseName);

    //查询会员的所有预约
    List<Reserve> getByMember(Integer memberId);

    //查询课程的所有预约
    List<Reserve> getByCourse(Integer courseId);

    //通过会员姓名和课程名称查询预约的方法
    List<Reserve> selectByMemberNameAndCourseName(String memberName, String courseName);


}
